#include "../../../../mac/mac.h"

LIST(list);

int8 buf_init_test()
{
    int8 r, j;
    r = list_init(list);
    j = buf_init();
    if (r != MAC_OK || j != MAC_OK) {
        return MAC_ERR;
    } else {
        return MAC_OK;
    }
}

int8 buf_alloc_test(is_trx)
{
    int8 r;
    buf_t *buf;
    buf = buf_alloc(is_trx);
    if (buf == NULL) {
        return MAC_ERR;
    } else {
        MAC_DEBUG("buf_alloc_test: 1\n");
        r = list_add_head(list, buf);
        return r;
    }
}

int8 buf_free_test()
{
    buf_t *buf;
    buf = list_del_head(list);
    if (buf == NULL) {
        MAC_DEBUG("buf_free_test: 1\n");
        return MAC_ERR;
    } else {
        return buf_free(buf);
    }
}

